package com.aydx.remotevaluezookeeper;

import com.aydx.remotevaluezookeeper.config.CuratorTemplate;
import com.aydx.remotevaluezookeeper.properties.ZkValueZookeeperProperties;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan(value = "com.aydx.remotevaluezookeeper")
@EnableConfigurationProperties(value = {ZkValueZookeeperProperties.class})
public class RemoteValueZookeeperAutoConfiguration implements DisposableBean {
    @Autowired
    CuratorTemplate curatorTemplate;
    @Override
    public void destroy() throws Exception {
        //此处可以用来关闭
        this.curatorTemplate.close();
    }
}
